package org.spring.service.Impl;

import org.spring.dao.TeacherDao;
import org.spring.domain.Teacher;
import org.spring.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("teacherService")
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherDao teacherDao;

    @Override
    public void saveTeacher(Teacher teacher) {
        teacherDao.insert(teacher);
    }

    @Override
    public void deleteTeacher(Integer id) {
        teacherDao.delete(id);
    }

    @Override
    public void updateTeacher(Teacher teacher) {
        teacherDao.update(teacher);
    }

    @Override
    public List<Teacher> findAll() {
        return teacherDao.findAll();
    }

    @Override
    public Teacher findOne(Integer id) {
        return teacherDao.findOne(id);
    }
}
